package com.neusoft.ysu.populationmanagement.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.neusoft.ysu.populationmanagement.vo.VResPop;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author qym
 * @since 2025-06-13
 */
@TableName("res_pop")
@Data
public class ResPop implements Serializable {
    public ResPop(){}
    public ResPop(VResPop vResPop) {
        this.popId = vResPop.getId();
        this.housenum = vResPop.getHousenum();
        this.housetypeId = vResPop.getHousetypeId();
        this.relationId = vResPop.getRelationId();
        this.work = vResPop.getWork();
        this.servicePlace = vResPop.getServicePlace();
        this.isDelete = vResPop.getIsDelete();
    }

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private Long popId;

    private String housenum;

    private Long housetypeId;

    private Long relationId;

    private String work;

    private String servicePlace;


    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    private Integer isDelete;

}
